package com.alisls.demo.springcloud.stream.rabbit.producer;

import com.alisls.demo.springcloud.stream.rabbit.channel.MyProcessor;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 描述信息
 *
 * @author Ke Wang
 * @date 2020/10/15
 */
@Component
public class MessageProducer {

    @Resource
    private MyProcessor myProcessor;

    public void sendMessage(Object message) {
        myProcessor.myOutput().send(MessageBuilder.withPayload(message).build());
    }

}
